package com.ruoyi.swap.openapi.Kline.mapper;

import java.util.List;
import com.ruoyi.swap.openapi.Kline.domain.SwapOpenapiKline;
import com.ruoyi.swap.openapi.Kline.domain.VO.SwapOpenapiKlineVO;
import org.apache.ibatis.annotations.Param;

/**
 * K线/蜡烛图Mapper接口
 * 
 * @author saumell
 * @date 2024-08-19
 */
public interface SwapOpenapiKlineMapper 
{
    /**
     * 查询K线/蜡烛图
     * 
     * @param id K线/蜡烛图主键
     * @return K线/蜡烛图
     */
    public SwapOpenapiKlineVO selectSwapOpenapiKlineById(Integer id);

    /**
     * 查询K线/蜡烛图列表
     * 
     * @param swapOpenapiKline K线/蜡烛图
     * @return K线/蜡烛图集合
     */
    public List<SwapOpenapiKlineVO> selectSwapOpenapiKlineList(SwapOpenapiKlineVO swapOpenapiKline);

    List<SwapOpenapiKlineVO> selectSwapAllData();

    Integer queryCurryNumber(@Param("currencyPair")String currencyPair);

    Integer selectLatestIdByApiCurrencyPair(@Param("apiCurrencyPair") String apiCurrencyPair);

    int incrementFailById(@Param("id") Integer id,
                           @Param("lastExecutionTime") java.util.Date lastExecutionTime,
                           @Param("callingState") String callingState,
                           @Param("lastFailureReason") String lastFailureReason);

    int incrementSuccessById(@Param("id") Integer id,
                              @Param("lastExecutionTime") java.util.Date lastExecutionTime,
                              @Param("callingState") String callingState);

    /**
     * 新增K线/蜡烛图
     * 
     * @param swapOpenapiKline K线/蜡烛图
     * @return 结果
     */
    public int insertSwapOpenapiKline(SwapOpenapiKline swapOpenapiKline);

    /**
     * 修改K线/蜡烛图
     * 
     * @param swapOpenapiKline K线/蜡烛图
     * @return 结果
     */
    public int updateSwapOpenapiKline(SwapOpenapiKline swapOpenapiKline);

    /**
     * 删除K线/蜡烛图
     * 
     * @param id K线/蜡烛图主键
     * @return 结果
     */
    public int deleteSwapOpenapiKlineById(Integer id);

    /**
     * 批量删除K线/蜡烛图
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteSwapOpenapiKlineByIds(Integer[] ids);
}
